const baseURL=getApp().config.baseURL;
const openid=wx.getStorageSync('openid');
module.exports=(url,data={},method='GET',header={openid})=>{
  wx.showLoading({
    title: '加载中',
  })
  return new Promise(function(resolve,reject){
      wx.request({
        url:baseURL+url,
        method,
        data,
        header,
        dataType:'json',
        success:resolve,
        fail:reject,
        complete:wx.hideLoading
      })
  });
}